<?php
	include "database.php";
	
	function studentListing($classID) {
			// @TODO - get username from GTMob
			global $_USER;
			$username = $_USER['uid'];
			//$username = "desposito6"; // Debug
			$userID = getUserID($username);
			
			if (!is_numeric($classID)) {
				die("Invalid Class ID");
			}
			if (!validateUser($classID, $userID)) {
				die("You do not have access to this class.");
			}

		echo 	"<h3>View Students</h3>
				<ul id='listview' data-role='listview' data-theme='d'>";
					// List Students
					$result = getRoster($classID);
					while($row = mysql_fetch_array($result)) {
						echo "<li><img src='" . $row['imageURL'] . "'/>" . $row['name'] . "</li>";
					}
		echo	"</ul>";
			// Close the MySQL database connection
			mysql_close($db);
	}
?>
